﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Baggr.ClientSite.Models
{
    public static class FeedItemsFilterHelper
    {
        private static SelectListItem ToSelectListItem(FeedItemsFilter filter, bool selected)
        {
            return new SelectListItem()
                       {
                           Selected = selected,
                           Text = filter.Text,
                           Value = filter.AsString
                       };
        }
        public static IEnumerable<SelectListItem> ToSelectListItems(this FeedItemsFilter selected)
        {
            return FeedItemsFilter.All
                .Select(curr => ToSelectListItem(curr, curr == selected));
        }
    }
}
